package com.example.test

import android.os.Bundle
import android.widget.ListView
import androidx.appcompat.app.AppCompatActivity
import android.widget.ArrayAdapter

class HistoryActivity : AppCompatActivity() {

    private lateinit var historyList: ListView
    private lateinit var adapter: ArrayAdapter<String>
    private lateinit var history: ArrayList<String>

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_history)

        historyList = findViewById(R.id.historyList)
        history = intent.getStringArrayListExtra("history") ?: arrayListOf()

        adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, history)
        historyList.adapter = adapter
    }
}
